package com.atguigu;

import com.streamxhub.streamx.flink.core.StreamEnvConfig;
import com.streamxhub.streamx.flink.core.java.source.KafkaSource;
import com.streamxhub.streamx.flink.core.scala.StreamingContext;

/**
 * @Author lzc
 * @Date 2022/4/27 15:20
 */
public class Streamx_kafka {
    public static void main(String[] args) {
        StreamEnvConfig config = new StreamEnvConfig(args, null);
        StreamingContext ctx = new StreamingContext(config);
        
        new KafkaSource<String>(ctx)
            .topic("s1")
            .getDataStream()
            .map(r -> r.value())
            .print("s1");
        
        new KafkaSource<String>(ctx)
            .topic("s2")
            .getDataStream()
            .map(r -> r.value())
            .print("s2");
        
        
        ctx.start();
    }
}
